<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>2D案例</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }
        
        .box {
            width: 100px;
            height: 100px;
            background-color: black;
            position: relative;
            /* overflow: hidden; */
            margin: 100px auto;
            border: 2px solid black;
        }
        
        .box::before {
            position: absolute;
            width: 100px;
            height: 100px;
            transition: all .4s ease;
            transform-origin: left bottom;
            background-color: aquamarine;
            content: "厉害厉害";
        }
        
        .box::after {
            position: absolute;
            width: 100px;
            height: 100px;
            content: "洪潇涵";
            background-color: aqua;
            transition: all .4s ease;
            transform-origin: left bottom;
            transform: rotate(180deg);
        }
        
        .box:hover::after {
            transform: rotate(0deg);
        }
        
        .box:hover::before {
            transform: rotate(-180deg);
        }
        
        .a {
            width: 55px;
            height: 55px;
            position: relative;
            overflow: hidden;
            background-color: #ff6700;
            margin: 100px auto;
            /* overflow: hidden; */
        }
        
        .a::after {
            position: absolute;
            content: url('https://s02.mifile.cn/assets/static/image/mi-logo.png');
            width: 55px;
            height: 55px;
            line-height: 55px;
            text-align: center;
            background-color: #ff6700;
            transform: translateX(100px);
            transition: all .5s ease;
        }
        
        .a:hover::after {
            transform: translateX(0px);
        }
        
        .a::before {
            line-height: 55px;
            text-align: center;
            position: absolute;
            content: url('https://s02.mifile.cn/assets/static/image/mi-home.png');
            width: 55px;
            height: 55px;
            background-color: #ff6700;
            transition: all .5s ease;
        }
        
        .a:hover::before {
            transform: translateX(-100px);
        }
    </style>

</head>

<body>

    <div class="box">

    </div>



    <div class="a"></div>



</body>

</html>